package com.price.compare.service;

import com.price.compare.common.JsonResult;
import com.price.compare.entity.Material;
import com.baomidou.mybatisplus.extension.service.IService;
import com.price.compare.qo.MaterialQO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * ç‰©æ–™è¡¨ 服务类
 * </p>
 *
 * @author ccp
 * @since 2024-11-06
 */
public interface MaterialService extends IService<Material> {

    JsonResult queryPageList(MaterialQO materialQO);

    List<Material> queryList();

    /**
     * 批量新增
     *
     * @param list
     * @return
     */
    JsonResult batchAdd(List<Material> list);

    /**
     * 批量修改
     *
     * @param list
     * @return
     */
    JsonResult batchUpdate(List<Material> list);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    JsonResult batchDelete(List<Long> ids);

    /**
     * 查询列表所有数据
     */
    JsonResult getList(MaterialQO materialQO);

    /**
     * 上传
     *
     * @param file
     * @return
     */
    JsonResult uploadExcel(MultipartFile file);

    /**
     * 单行新增
     *
     * @param obj
     * @return
     */
    JsonResult add(Material obj);

    /**
     * 单行修改
     *
     * @param obj
     * @return
     */
    JsonResult update(Material obj);

    /**
     * 单行删除
     *
     * @param id
     * @return
     */
    JsonResult delete(Long id);

    /**
     * OR数据导入_导出
     *
     * @param materialQO
     * @param response
     */
    void downloadData(MaterialQO materialQO, HttpServletResponse response);

    /**
     * 单个查询_根据id查询
     *
     * @param id
     * @return
     */
    Material getOrById(Long id);
}
